
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.servlet;

import com.qdu.entity.Note;
import com.qdu.service.NoteService;
import com.qdu.service.impl.NoteServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//根据发布主题搜索日志
@WebServlet("/ooo")
public class GetNoteByTopicServlet extends HttpServlet{
    
    NoteService ps=new NoteServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        String Ntopic= req.getParameter("Ntopic");
        List<Note> list = ps.findNoteByNtopic(Ntopic);
        req.setAttribute("note_list", list);
        req.getRequestDispatcher("/SearchNote.jsp").forward(req, resp);
    }
    
}
